package com.nts.visionworks.business.endpoint.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Range;

/**
 * EndPointCategory generated by hbm2java
 */
@Entity
@Table(name = "end_point_category", catalog = "visionworks")
public class EndPointCategory implements java.io.Serializable
{

	private Long categoryId;
	private long parentCategoryId;
	private int depth;
	private int displayOrder;
	private String categoryName;
	private Date createdDateTime;
	private Date updatedDateTime;
	private Set<EndPoint> endPoints = new HashSet<EndPoint>(0);

	public EndPointCategory()
	{
	}

	public EndPointCategory(long parentCategoryId, int depth, int displayOrder,
			String categoryName, Date createdDateTime)
	{
		this.parentCategoryId = parentCategoryId;
		this.depth = depth;
		this.displayOrder = displayOrder;
		this.categoryName = categoryName;
		this.createdDateTime = createdDateTime;
	}

	public EndPointCategory(long parentCategoryId, int depth, int displayOrder,
			String categoryName, Date createdDateTime, Date updatedDateTime,
			Set<EndPoint> endPoints)
	{
		this.parentCategoryId = parentCategoryId;
		this.depth = depth;
		this.displayOrder = displayOrder;
		this.categoryName = categoryName;
		this.createdDateTime = createdDateTime;
		this.updatedDateTime = updatedDateTime;
		this.endPoints = endPoints;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "CategoryId", unique = true, nullable = false)
	public Long getCategoryId()
	{
		return this.categoryId;
	}

	public void setCategoryId(Long categoryId)
	{
		this.categoryId = categoryId;
	}

	@Column(name = "ParentCategoryId", nullable = false)
	public long getParentCategoryId()
	{
		return this.parentCategoryId;
	}

	public void setParentCategoryId(long parentCategoryId)
	{
		this.parentCategoryId = parentCategoryId;
	}

	@Min(message = "validation.endPoint.endPointCategory.depth.min", value = 1)
	@Column(name = "Depth", nullable = false)
	public int getDepth()
	{
		return this.depth;
	}

	public void setDepth(int depth)
	{
		this.depth = depth;
	}

	@Min(message = "validation.endPoint.endPointCategory.displayOrder.min", value = 1)
	@Column(name = "DisplayOrder", nullable = false)
	public int getDisplayOrder()
	{
		return this.displayOrder;
	}

	public void setDisplayOrder(int displayOrder)
	{
		this.displayOrder = displayOrder;
	}

	@NotNull(message = "validation.endPoint.endPointCategory.categoryName.notNull")
	@Size(message = "validation.endPoint.endPointCategory.categoryName.length", max = 40, min = 1)
	@Column(name = "CategoryName", nullable = false, length = 40)
	public String getCategoryName()
	{
		return this.categoryName;
	}

	public void setCategoryName(String categoryName)
	{
		this.categoryName = categoryName;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", nullable = false, length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "endPointCategories")
	public Set<EndPoint> getEndPoints()
	{
		return this.endPoints;
	}

	public void setEndPoints(Set<EndPoint> endPoints)
	{
		this.endPoints = endPoints;
	}

}
